package com.example.framentandtabhosttest1.custom;

import java.util.ArrayList;

import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class SelectSpinAdapter extends ArrayAdapter<String> {
    Context context;

    public SelectSpinAdapter(final Context context,
            final int textViewResourceId, final ArrayList<String> list) {
        super(context, textViewResourceId, list);
        this.context = context;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    	TextView tv;
        if (convertView == null) {
        	convertView = new TextView(context);
        	tv = (TextView) convertView;
        	tv.setHeight(64);
        	tv.setGravity(Gravity.CENTER);
        	tv.setTextSize(12.4f);
        	tv.setTextColor(Color.WHITE);
        }
       
        tv = (TextView)convertView;       
        tv.setWidth(parent.getWidth());
        tv.setText(getItem(position));
        return convertView;
    }
    
}
